<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset id="searchFieldset_currentTable" class="table-search-fieldset layui-hide">
            <legend>{:lang("common.condition_search")}</legend>
            <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("common.create_time")}</label>
                    <div class="layui-input-inline">
                        <input name="l_create_time_range" class="layui-input"
                               placeholder="{:lang('common.choose')}{:lang('common.create_time')}"
                               data-date data-date-range="-">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("log.username")}</label>
                    <div class="layui-input-inline">
                        <input name="u_username_like" value="{$param.u_username_like|default=''}"
                               placeholder="{:lang('common.input')}{:lang('log.username')}" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("log.method")}</label>
                    <div class="layui-input-inline">
                        <input name="l_method_eq" placeholder="{:lang('common.input')}{:lang('log.method')}"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("log.url")}</label>
                    <div class="layui-input-inline">
                        <input name="l_url_like" placeholder="{:lang('common.input')}{:lang('log.url')}"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("log.fingerprint")}</label>
                    <div class="layui-input-inline">
                        <input name="l_fingerprint_like" placeholder="{:lang('common.input')}{:lang('log.fingerprint')}"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("log.ip")}</label>
                    <div class="layui-input-inline">
                        <input name="l_ip_eq" placeholder="{:lang('common.input')}{:lang('log.ip')}"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline" style="margin-left:50px">
                    <button type="submit" class="layui-btn layui-btn-normal" data-type="tableSearch"
                            lay-submit lay-filter="search_currentTable">{:lang("common.btn_search")}
                    </button>
                </div>
            </form>
        </fieldset>

        <table id="currentTable"
               data-auth-print="{:auth(request()->controller().'/print')}"
               data-auth-export="{:auth(request()->controller().'/export')}">
        </table>
    </div>
</div>
<script>
    layui.use(['myCommon'], function () {
        let myCommon = layui.myCommon;
        myCommon.table.render({
            where: myCommon.generateCondition()
            , cols: [[
                {field: 'id', title: '{:lang("common.id")}', width: 80, sort: true}
                , {field: 'username', minWidth: 80, title: '{:lang("log.username")}', sort: true}
                , {field: 'method', minWidth: 80, title: '{:lang("log.method")}', sort: true}
                , {field: 'url', minWidth: 80, title: '{:lang("log.url")}', sort: true}
                , {field: 'fingerprint', minWidth: 180, title: '{:lang("log.fingerprint")}', sort: true}
                , {field: 'content', minWidth: 80, title: '{:lang("log.content")}'}
                , {field: 'ip', minWidth: 80, title: '{:lang("log.ip")}'}
                , {field: 'useragent', minWidth: 80, title: '{:lang("log.useragent")}'}
                , {field: 'create_time', minWidth: 80, title: '{:lang("common.create_time")}', sort: true}
            ]]
        });
        myCommon.listen();
    });
</script>
